package org.spark.core.transformations.scala

import org.spark.sparkUtil.SparkScalaContextUtil

/**
  * 功能概述:
  * Datetime:    2020/5/25   18:52
  * Author:   某人的目光
  */
object FlatMap {

  def main(args: Array[String]): Unit = {
    val sc = SparkScalaContextUtil.getSparkStart("flatMap");
    val lineArray = Array("hello you", "hello me", "hello world")
    val lines = sc.parallelize(lineArray, 1)
    val words = lines.flatMap { line => line.split(" ") }

    words.foreach { word => println(word) }
  }

}
